    
    
    scalar addBedLength = 0.1;
    point addBedLengthLoc(Zero); 
    // 遍历所有边界Patch
    const polyBoundaryMesh& patches = mesh.boundaryMesh();
    
    forAll(patches, patchI)
    {
        if(patches[patchI].name() == bedPatchName)
        {
            const polyPatch& patch = patches[patchI];
            
            Info<< "\nProcessing Bed patch: " << patch.name() << nl;

            // 获取面法向矢量（已单位化）
            const vectorField& faceNormals     = patch.faceNormals();
            const vectorField& bedFaceCenters  = patch.faceCentres();

            // 计算每个面的角度
            forAll(faceNormals, faceI)
            {
                scalar cosTheta = faceNormals[faceI] & refDir;
                scalar angleDeg = Foam::acos(cosTheta) * 180.0 / M_PI;


                if(streamDir == 0 && spanDir == 2)
                {
                    label  globalFaceI = faceI + patch.start();
                    Info << "On bed patch, face got : " << mesh.faces()[globalFaceI].size() << " vertices: " << endl;
                    
                    forAll(mesh.faces()[globalFaceI], vertI)
                    {
                        Info  <<   mesh.points()[mesh.faces()[globalFaceI][vertI]] << endl; 
                    }                    
                    // TODO: 尝试将这段替换为用网格拓扑的接口来做。
                   addBedLengthLoc[streamDir] = bedFaceCenters[faceI].x() + std::abs(addBedLength * Foam::cos(angleDeg));
                   addBedLengthLoc[1]   = bedFaceCenters[faceI].y() + std::abs(addBedLength * Foam::sin(angleDeg));
                   boxFile << "(" << bedFaceCenters[faceI].x() - std::abs(bedStreamHalfGridLength * Foam::cos(angleDeg))   << " " //sub point
                           << bedFaceCenters[faceI].y() - std::abs(bedStreamHalfGridLength * Foam::sin(angleDeg)) << " " 
                           << bedFaceCenters[faceI].z() - bedSpanHalfGridLength << ")" 
                           << "(" << addBedLengthLoc[streamDir] + std::abs(bedStreamHalfGridLength * Foam::cos(angleDeg))  << " "  // upper point
                           << addBedLengthLoc[1] + std::abs(bedStreamHalfGridLength * Foam::sin(angleDeg)) << " " 
                           << bedFaceCenters[faceI].z() + bedSpanHalfGridLength << ")\n";  
                }
                else
                {
                    FatalError  
                    << "NOT IMPLEMENTED..."  
                    << exit(FatalError);  
                }

                // 写入CSV文件
                outputFile << patch.name() << ","
                            << faceI << ","
                            << angleDeg << endl;
            }
            
            break;
        }
    }